package com.cby.jetpack.sample.paging3.data.repository

import com.cby.jetpack.sample.paging3.bean.GankApiResponse
import com.cby.jetpack.sample.paging3.bean.GankGirlBean
import com.cby.jetpack.sample.paging3.data.api.GankApi

/**
 * @description: GankGirlRepository
 *
 * @author ChenBaoyang
 * @date 8/12/21 13:49
 */
class GankGirlRepository {

    private var gankApi = GankApi.getGankService(
        GankApi::class.java
    )

    /**
     * 查询护理数据
     */
    suspend fun loadData(
        pageId: Int
    ): GankApiResponse<List<GankGirlBean>>? {
        return try {
            gankApi.loadGankGirlList(pageId)
        } catch (e: Exception) {
            //在这里处理或捕获异常
            null
        }

    }
}